Repository navigation
Conversation
Move the model implementation from `petab/v1/models` to `petab/_models`, and the PySB and BNGL tests and fixtures from `tests/v1` to `tests/models`, without changes; the imports are fixed in the next commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The model classes serve both PEtab v1 and v2, but lived in `petab.v1.models`, with `petab.v2.models` re-exporting them. This suggested that PySB and BNGL models were supported with PEtab v1. Move the implementation to the private package `petab._models` (in the previous commit; here, only imports change). `petab.v1.models` and `petab.v2.models` re-export it. Deprecate (for now only in the changelog) the PySB and BNGL modules in `petab.v1.models`. Move the PySB and BNGL tests and fixtures to `tests/models`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add a private classification of model entities (`petab._models._entities`, `Model._get_entity`, `Model._iter_entities`), implemented for SBML models: what an entity is (parameter, species, compartment, other quantity, non-quantity), how its value evolves (constant, differential, algebraic), and how the model defines its initial value. Use it in the new v2 validation task `CheckModelEntityEligibility`, which reports errors for entities that PEtab v2 does not allow as condition targets or in the parameter table, e.g. targets of assignment rules or event assignments, and warnings for questionable uses. Models without classification support are skipped. References PEtab-dev#518. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #623 +/- ##
==========================================
+ Coverage 80.18% 80.76% +0.58%
==========================================
Files 70 76 +6
Lines 8442 8808 +366
Branches 1544 1614 +70
==========================================
+ Hits 6769 7114 +345
- Misses 1182 1193 +11
- Partials 491 501 +10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a new v2 validation task
CheckModelEntityEligibility. It reports errors for model entities that the PEtab v2 specification does not allow as condition targets (e.g., targets of assignment rules, or species changed by reactions) or in the parameter table (e.g., targets of assignment rules, rate rules, or event assignments), and warnings for questionable but valid uses. Mapping-table aliases are resolved; models without the required support are skipped.To support this, models can now classify their entities: what an entity is (parameter, species, compartment, other quantity, non-quantity), how its value evolves (constant, differential, algebraic), and how its initial value is defined. This is private for now (
petab._models._entities,Model._get_entity,Model._iter_entities) and implemented for SBML models; PySB and BNGL follow separately.Depends on #622; only the commits after it belong to this PR.
🤖 Generated with Claude Code